﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 装饰模式.Decorator;

namespace 装饰模式
{
    /// <summary>
    /// 1 装饰器模式 Decorator
    /// 2 对象在运行的过程中，不断的增加新功能(AOP)
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //{
            //    BaseCharacter mage = new Mage();
            //    mage.Show();
            //}
            //Console.WriteLine("**********************************");
          
            //{
            //    BaseCharacter mage = new MageWithHelmet();
            //    mage.Show();
            //}

            //Console.WriteLine("**********************************");;
            //{
            //    BaseCharacter mage = new MageWithShoulder();
            //    mage.Show();
            //}

            //Console.WriteLine("**********************************"); ;
            //{
            //    BaseCharacter mage = new Mage();
            //    //BaseDecorator decorator = new BaseDecorator(mage);
            //    //decorator.Show();
            //    mage = new BaseDecorator(mage);
            //    mage.Show();
            //}

            Console.WriteLine("**********************************"); ;
            {
                BaseCharacter mage = new Mage();
                mage = new BaseDecorator(mage);
                mage = new DecoratoHelmet(mage);
                mage = new DecoratoShoulder(mage);
                mage = new DecoratorGlove(mage);
                mage.Show();
            }
            Console.Read();
        }
    }
}
